package com.lzhsite.technology.designPattern.strategy.LogTemplateDemo;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public abstract class LogStrategyTemplate implements LogStrategy
{
    public final void log(String logMessage)
    {
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");
        logMessage = dateFormat.format(new Date()) + " 内容是：" + logMessage;
        doLog(logMessage);
    }

    protected abstract void doLog(String logMessage);
}
